﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 方法重载
{
    class Area
    {
        public double a { get; set; }
        public double b { get; set; }

        public Area(double a, double b)
        {
            this.a = a;
            this.b = b;
        }

        public Area(double a)
        {
            this.a = a;
        }
        public void area(double a)
        {
            double c = a * a * 3.14;
            Console.WriteLine($"圆的面积为：{c}");
        }
        public void area(double a, double b)
        {
            double c = a * b;
            Console.WriteLine($"长方形的面积为：{c}");
        }
    }
}
